<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 2020-06-16
 * Time: 17:13
 */

namespace app\api\model;


class User extends BaseModel
{
    public function getGenderAttr($value)
    {
        if($value == 1) {
            return '男';
        } elseif($value == 2) {
            return '女';
        } else {
            return '未知';
        }
    }

    // 用户分享
    public function invite()
    {
        return $this->belongsTo('UserInvitation','id','invitee');
    }
}